import request from '@/utils/request'

/** 生产计划管理*/
export function listProducePlan(data) {
  return request({
    url: '/ims/process/plan/page', method: 'get', params: data
  })
}

export function addProducePlan(data) {
  return request({
    url: '/ims/process/plan/add', method: 'post', data: data
  })
}

export function updateProducePlan(data) {
  return request({
    url: '/ims/process/plan/edit', method: 'post', data: data
  })
}
export function shareProducePlan(data) {
  return request({
    url: '/ims/process/plan/assignPlan', method: 'post', data: data
  })
}

export function deleteProducePlan(data) {
  return request({
    url: '/ims/process/plan/' + data, method: 'delete', params: data
  })
}

/** 工序管理*/
export function listProduceProcess(data) {
  return request({
    url: '/ims/process/page', method: 'get', params: data
  })
}

export function addProduceProcess(data) {
  return request({
    url: '/ims/process/add', method: 'post', data: data
  })
}

export function updateProduceProcess(data) {
  return request({
    url: '/ims/process/edit', method: 'post', data: data
  })
}

export function deleteProduceProcess(data) {
  return request({
    url: '/ims/process/' + data, method: 'delete', params: data
  })
}


/** 工艺管理*/
export function listProduceWork(data) {
  return request({
    url: '/ims/process/flow/page', method: 'get', params: data
  })
}

export function addProduceWork(data) {
  return request({
    url: '/ims/process/flow/add', method: 'post', data: data
  })
}

export function updateProduceWork(data) {
  return request({
    url: '/ims/process/flow/edit', method: 'post', data: data
  })
}

export function deleteProduceWork(data) {
  return request({
    url: '/ims/process/flow/' + data, method: 'delete', params: data
  })
}

/** 报工统计*/
export function listWorkTotal(data) {
  return request({
    url: '/ims/produce/statistic/page', method: 'get', params: data
  })
}

/** 生产BOM*/
export function lisProduceBom(data) {
  return request({
    url: '/ims/produce/bom/page', method: 'get', params: data
  })
}
export function addProduceBom(data) {
  return request({
    url: '/ims/produce/bom/save', method: 'post', data: data
  })
}
export function updateProduceBom(data) {
  return request({
    url: '/ims/produce/bom/edit', method: 'post', data: data
  })
}
export function deleteProduceBom(data) {
  return request({
    url: '/ims/produce/bom/delete', method: 'post', data: data
  })
}
export function getProduceProcess(data) {
  return request({
    url: '/ims/produce/plan/record/list', method: 'get', params: data
  })
}
